package algocasts;

public class P32_ClimbStairs {
    public int climbStairs_Recursive(int n) {
        if (n < 2) return 1;
        return climbStairs_Recursive(n - 1) + climbStairs_Recursive(n - 2);
    }

    public int climbStairs_Iterative(int n) {
        int first = 1, second = 1;
        for (int i = 2; i <= n; i++) {
            int third = first + second;
            first = second;
            second = third;
        }
        return second;
    }
}
